package com.oa.co.controller;

import com.github.pagehelper.PageInfo;
import com.oa.co.common.PageVo;
import com.oa.co.pojo.Pc;
import com.oa.co.service.PcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/pc")
@RestController
public class PcController {

    @Autowired
    private PcService pcService;

    @RequestMapping("/selectPc")
    public PageVo<Pc> selectPcByCondition(Integer page,Integer limit,Integer pc_id, String pc_user) {

        PageVo<Pc> pcPageVo = new PageVo<>();

        PageInfo<Pc> pageData = pcService.getPageData( page, limit, pc_id,  pc_user);
        pcPageVo.setData(pageData.getList());

        pcPageVo.setCode(0);
        pcPageVo.setCount(pageData.getTotal());
        pcPageVo.setMsg("分页信息");


        return pcPageVo;
    }


}
